/**
 * @author Jason Pratt
 */

package edu.cmu.cs.stage3.alice.authoringtool.util;

import edu.cmu.cs.stage3.alice.core.Property;
import edu.cmu.cs.stage3.alice.core.event.ScheduleListener;

public class OneShotScheduler extends edu.cmu.cs.stage3.alice.core.Scheduler {

 public boolean isPropertyAffected( edu.cmu.cs.stage3.alice.core.Property property ) {
  edu.cmu.cs.stage3.alice.core.event.ScheduleListener[] scheduleListeners = getScheduleListeners();
  //LOB for (ScheduleListener sl : scheduleListeners)
  int t_tam = scheduleListeners!=null ? scheduleListeners.length : 0;
  for (int i_i=0; i_i<t_tam; i_i++) {
   if( scheduleListeners[i_i] instanceof edu.cmu.cs.stage3.alice.authoringtool.util.OneShotSimpleBehavior ) { //L sl instanceof ...
    //L ((edu.cmu.cs.stage3.alice.authoringtool.util.OneShotSimpleBehavior)sl).getAffectedProperties()
    edu.cmu.cs.stage3.alice.core.Property[] affectedProperties = ((edu.cmu.cs.stage3.alice.authoringtool.util.OneShotSimpleBehavior)scheduleListeners[i_i]).getAffectedProperties();
    //LOB for (Property affectedPropertie : affectedProperties)
    for (int i_j=0; i_j<t_tam; i_j++) {
     if (property == affectedProperties[i_j]) { //L (property == affectedPropertie)
      return true;
      }
    }
   }
  }
  return false;
 }

}
